
<template>
  <el-container style="height: 100vh;">
    <el-header style="background-color: #263238;">
       <home-head :info="user" :token="token"></home-head>
      </el-header>
    <el-container>
         <!-- 左边菜单栏部分 -->
         <home-aside :info="user" ></home-aside>
      <el-main>
         <RouterView></RouterView>
      </el-main>
    </el-container>
  </el-container>
</template>
<script setup>
import HomeAside from '@/components/HomeAside.vue';
import HomeHead from '@/components/HomeHead.vue';
import {ref,onMounted } from 'vue';
import userApi from '../api/public/public.js'
import Cookies from 'js-cookie'
const token = Cookies.get('token');

let user=ref({
  username:'',
  avatar:'',
  id:''
})
onMounted(()=>{
  userApi.getAdminInfo(token).then(response=>{
      console.log(response)
      user.value=response.data.data.user;
  });
});
</script>
<style>


/* 水平时，去除底部白边。 */
.el-menu.el-menu--horizontal {
  border-bottom: 0;
}
</style>